package com.sh.构造器模式;


/**
 * 提供set方法， 但是这种方法不能保证一致性，因为类可能被多出调用
 */
public class CarBean {
    /**
     * 必需属性
     */
    private String carBody;//车身
    private String tyre;//轮胎
    private String engine;//发动机
    private String aimingCircle;//方向盘

    @Override
    public String toString() {
        return "CarBean{" +
                "carBody='" + carBody + '\'' +
                ", tyre='" + tyre + '\'' +
                ", engine='" + engine + '\'' +
                ", aimingCircle='" + aimingCircle + '\'' +
                ", decoration='" + decoration + '\'' +
                '}';
    }

    /**
     * 可选属性
     */
    private String decoration;//车内装饰品

    public void setCarBody(String carBody) {
        this.carBody = carBody;
    }

    public void setTyre(String tyre) {
        this.tyre = tyre;
    }

    public void setEngine(String engine) {
        this.engine = engine;
    }

    public void setAimingCircle(String aimingCircle) {
        this.aimingCircle = aimingCircle;
    }

    public void setDecoration(String decoration) {
        this.decoration = decoration;
    }
}

